<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        
        var a = prompt("请输入小明的成绩");  //prompt()可以弹出一个提示框，提示框会带一个文本框
        if(a == 100){
            document.write("奖励一辆BMW");

        }else if (a >= 80 && a<=99) {
            document.write("奖励一台iPhone15s");
        } else if (a >=60 && a<=79) {
            document.write("奖励一本参考书");
        }else if (a <60 && a>=0) {
            document.write("没有奖励");
        }else{
            document.write("输入违法数据");
        }
    </script>
</head>
<body>
    
</body>
</html>